<?php

/**
 * OperadoresIngreso form base class.
 *
 * @method OperadoresIngreso getObject() Returns the current form's model object
 *
 * @package    cronos-doctrine
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseOperadoresIngresoForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'               => new sfWidgetFormInputHidden(),
      'concepto_cf_id'   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ConceptoCf'), 'add_empty' => false)),
      'empresa_id'       => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Empresa'), 'add_empty' => false)),
      'agendado_id'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Agendado'), 'add_empty' => true)),
      'camioneta_id'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Camioneta'), 'add_empty' => true)),
      'operador_id'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Operador'), 'add_empty' => false)),
      'cliente_id'       => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Cliente'), 'add_empty' => true)),
      'servicio_tipo_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ServicioTipo'), 'add_empty' => true)),
      'pago_id'          => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Pago'), 'add_empty' => false)),
      'banco_id'         => new sfWidgetFormInputText(),
      'numero_cheque'    => new sfWidgetFormInputText(),
      'cantidad'         => new sfWidgetFormInputText(),
      'descripcion'      => new sfWidgetFormTextarea(),
      'nota'             => new sfWidgetFormTextarea(),
      'monto'            => new sfWidgetFormInputText(),
      'monto_recibio'    => new sfWidgetFormInputText(),
      'monto_confirmado' => new sfWidgetFormInputText(),
      'is_sobre'         => new sfWidgetFormInputCheckbox(),
      'is_sobre_op'      => new sfWidgetFormInputCheckbox(),
      'fecha'            => new sfWidgetFormDateTime(),
      'created_at'       => new sfWidgetFormDateTime(),
      'updated_at'       => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'               => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'concepto_cf_id'   => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('ConceptoCf'), 'required' => false)),
      'empresa_id'       => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Empresa'), 'required' => false)),
      'agendado_id'      => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Agendado'), 'required' => false)),
      'camioneta_id'     => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Camioneta'), 'required' => false)),
      'operador_id'      => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Operador'))),
      'cliente_id'       => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Cliente'), 'required' => false)),
      'servicio_tipo_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('ServicioTipo'), 'required' => false)),
      'pago_id'          => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Pago'))),
      'banco_id'         => new sfValidatorInteger(array('required' => false)),
      'numero_cheque'    => new sfValidatorInteger(array('required' => false)),
      'cantidad'         => new sfValidatorInteger(array('required' => false)),
      'descripcion'      => new sfValidatorString(array('required' => false)),
      'nota'             => new sfValidatorString(array('required' => false)),
      'monto'            => new sfValidatorNumber(),
      'monto_recibio'    => new sfValidatorNumber(array('required' => false)),
      'monto_confirmado' => new sfValidatorNumber(array('required' => false)),
      'is_sobre'         => new sfValidatorBoolean(array('required' => false)),
      'is_sobre_op'      => new sfValidatorBoolean(array('required' => false)),
      'fecha'            => new sfValidatorDateTime(),
      'created_at'       => new sfValidatorDateTime(),
      'updated_at'       => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('operadores_ingreso[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'OperadoresIngreso';
  }

}
